import request from "@/utils/request";
import { ParseData } from "@/utils/utils";

//获取动态信息列表分页
export const GetDynamicList = (data: any) => {
  return request({
    method: "GET",
    url: `/dongtaizixun?${ParseData(data)}`,
  });
};
// 删除动态信息列表
export const DeleteDynamic = (data: any) => {
  return request({
    method: "DELETE",
    url: `/dongtaizixun/${data.id}`,
  });
};
// 动态资讯新增
export const AddDynamic = (data: any) => {
  return request({
    method: "POST",
    url: `/dongtaizixun`,
    data
  });
};
// 动态资讯编辑
export const EditDynamic = (data: any) => {
  return request({
    method: "PUT",
    url: `/dongtaizixun`,
    data
  });
};
// 动态信息上架下架操作
export const ChangeDynamicStatus = (data: any) => {
  return request({
    method: "PUT",
    url: `/dongtaizixun/${data.id}`,
  });
};
// 动态信息编辑信息
export const GetDynamic = (data: any) => {
  return request({
    method: "GET",
    url: `/dongtaizixun/${data.id}`,
  });
};
